import com.demoo.zjsu.util.HttpClientUtil.ClientImgDownloader;
import com.demoo.zjsu.util.HttpClientUtil.ClientSender;
import com.demoo.zjsu.util.HttpClientUtil.RequestConfigResolver;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import java.io.*;

/**
 * Created by jshjsh on 2016/8/14.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration("classpath*:spring-servlet.xml")
public class HttpClientDownload {



//http://www.hzic.edu.cn/UploadFiles/image/201411/2014112541985013.JPG
//    @Test
//    public void download(){
//
//        RequestConfigResolver resolver =
//                new RequestConfigResolver(2000, 2000, 2000, "http://www.hzic.edu.cn/UploadFiles/image/201411/2014112541985013.JPG");
//        resolver.resolver(new ClientImgDownloader("photo.jpg", System.getProperty("user.dir")));
//    }

//    @Test
    public void testPath(){
        String url = getClass().getClassLoader().getResource("").getPath();
        System.out.println(url);
    }

}
